﻿<UserControl   
  x:Class="HeritageAcademy.Library.Controls.LibraryBookView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:c="clr-namespace:HeritageAcademy.Library.Controls">
    <UserControl.Resources>

        <Storyboard x:Key="HideStoryboard" BeginTime="00:00:00.4" Completed="ShowHide_Completed">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.3" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Panel.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame  KeyTime="00:00:00.8" Value="0" KeySpline="0.6,0.2,0,1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame  KeyTime="00:00:00.3" Value="0" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="ShowStoryboard" BeginTime="00:00:00.1" Completed="ShowHide_Completed">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Panel.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame  KeyTime="00:00:00.8" Value="1" KeySpline="0.5,0.8,0,1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:0.7" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame  KeyTime="00:00:00.4" Value="1" KeySpline="0,0.5,0.5,1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>


        <Storyboard x:Key="ShowDetails" BeginTime="00:00:00" >
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsGrid" Storyboard.TargetProperty="(Panel.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.6" Value="1" KeySpline="0.5,0.8,0,1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:0.7" Storyboard.TargetName="DetailsGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame  KeyTime="00:00:00.3" Value="1" KeySpline="0,0.5,0.5,1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="HideDetails">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetName="DetailsGrid" Storyboard.TargetProperty="(Panel.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.6" Value="0" KeySpline="0.6,0.2,0,1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

    </UserControl.Resources>


    <Grid x:Name="LayoutRoot" Visibility="Visible" Opacity="1" Margin="-5,0,-5,0" SnapsToDevicePixels="True">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.LayoutTransform>
            <TransformGroup>
                <ScaleTransform />
                <SkewTransform />
                <RotateTransform/>
                <TranslateTransform X="0" />
            </TransformGroup>
        </Grid.LayoutTransform>
        <Grid.RenderTransform>
            <TransformGroup>
                <ScaleTransform />
                <SkewTransform />
                <RotateTransform/>
                <TranslateTransform X="0" />
            </TransformGroup>
        </Grid.RenderTransform>

        <!-- Shadows -->
        <Grid Margin="-50,-50,-50,20" Background="#0F00" IsHitTestVisible="False">
        <c:ElementRenderer >
                <Grid Margin="50,50,50,20" Background="Transparent" >
                    <Border Margin="-15,5,-5,20" Background="Black" Opacity="0.1">
                        <Border.Effect>
                            <BlurEffect Radius="25"/>
                        </Border.Effect>
                    </Border>
                    <Border Margin="0,30,-10,0" Background="Black" Opacity="0.1">
                        <Border.Effect>
                            <BlurEffect Radius="15"/>
                        </Border.Effect>
                    </Border>
                    <Border Margin="10,50,-25,0" Background="Black" Opacity="0.25">
                        <Border.Effect>
                            <BlurEffect Radius="20"/>
                        </Border.Effect>
                    </Border>
                    <Border Margin="-5,0,-5,-5" Background="Black" Opacity="0.1">
                        <Border.Effect>
                            <BlurEffect Radius="15"/>
                        </Border.Effect>
                    </Border>
                </Grid>
        </c:ElementRenderer>
            </Grid>

        <Image x:Name="BookImage" Stretch="None"  VerticalAlignment="Bottom" HorizontalAlignment="Center"  />

        <Border Height="1" VerticalAlignment="Bottom" Background="#8000" Margin="5,0,6,45" SnapsToDevicePixels="True" />
        <Border Width="1" HorizontalAlignment="Right" Margin="0,0,5,47" Background="#40000000" SnapsToDevicePixels="True" />

        <Canvas>
            <Border x:Name="TitleSite" >
                <TextBlock Margin="0,0" x:Name="BookTitleText" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="80" FontFamily="..\Fonts\#Cambria" TextWrapping="Wrap" TextAlignment="Center">
                    <TextBlock.LayoutTransform>
                        <RotateTransform x:Name="TitleSiteRotation" Angle="0" />
                    </TextBlock.LayoutTransform>
                </TextBlock>
            </Border>
        </Canvas>

        <Grid x:Name="DetailsGrid" Grid.Column="1" Opacity="0" >
            <Grid.LayoutTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="0" />
                    <SkewTransform />
                    <RotateTransform/>
                    <TranslateTransform X="0" />
                </TransformGroup>
            </Grid.LayoutTransform>
            <Path Width="491" Height="300" HorizontalAlignment="Left" Margin="-30,0,30,0" Data="M21,2.2E-12 L508.1,2.2E-12 C510.3,-2.2E-06 512.1,1.7 512.1,3.9 L512.1,296 C512.1,298.2 510.3,300 508.1,300 L66.1,300 C63.9,300 62.1,298.2 62.1,296 L62.1,39.8 z" Fill="#FFFF5619" Stretch="Fill" StrokeThickness="0"/>
        </Grid>

    </Grid>
</UserControl>
